<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="View.*" %>
<%@ page import="java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/index.css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>

<script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
		<script type="text/javascript" src="js/hoverIntent.js"></script>
		<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript">

	jQuery(function(){
		jQuery('ul.sf-menu').superfish();
	});
	
</script>

<%
ArrayList<CategoryView> cat = Controller.getCategoryTree();
%>

<body>
<div id="leftMenu">
	
	<ul class="sf-menu sf-vertical">
		<%
		for (int i = 0; i < cat.size(); i++) {
		%>
			<li class="current"><a href="/webshop/items/<%=cat.get(i).getName() %>/"><%=cat.get(i).getName() %></a>
			<input type="hidden" value="<%=cat.get(i).getName() %>" name="menu">
			<ul>
				<%
				ArrayList<CategoryView> catChilds = cat.get(i).getChild();
				for (int k = 0; k < catChilds.size(); k++) {
				%>
					<li class="current"><a href="/webshop/items/<%=cat.get(i).getName() %>/<%=catChilds.get(k).getName() %>/"><%=catChilds.get(k).getName() %></a>
					<input type="hidden" value="<%=catChilds.get(k).getName() %>" name="subMenu">
					<ul>
						<%
						ArrayList<CategoryView> catChildsChilds = catChilds.get(k).getChild();
						for (int j = 0; j < catChildsChilds.size(); j++) {
						%>
							<li class="current"><a href="/webshop/items/<%=cat.get(i).getName() %>/<%=catChilds.get(k).getName() %>/<%=catChildsChilds.get(j).getName() %>/"><%=catChildsChilds.get(j).getName() %></a></li>
							<input type="hidden" value="<%=catChildsChilds.get(j).getName() %>" name="subSubMenu">
						<%
						}
						%>
					</ul>
					</li>
				<%
				}
				%>
			</ul>
			</li>
		<%
		}
		%>
		</ul>
	
	</div>
</body>
</html>